import time
from util.serial.serialUtil import SerialUtil
serial = SerialUtil(port="COM2", timeout=1)

class Test():
    def __init__(self):
        serial.open()

    def setup(self):
        while True:
            print("pub", serial.pub("Give me string"), "Give me string")
            data = serial.sub(18).replace("\r\n", "")
            if(data): print("pub2", serial.pub(data), data)
            time.sleep(0.1)

if __name__ == '__main__':
    test = Test()
    test.setup()